<?php
$title='信息更改';
include 'header.php';
$pdo=null;
?>
  <link href="../assets/css/sweetalert2.min.css" rel="stylesheet" type="text/css">
<!--页面主要内容-->
<div class="main-content">
    <div class="page-content">
        <div class="container-fluid">
            <!-- start page title -->
            <div class="row">
                <div class="col-xl-6 offset-xl-3">
                    <div class="card">
                        <div class="card-body">
                            <form class="custom-validation" onsubmit="return false;">
                                <div class="mb-3"><label class="form-label">管理员账号：</label>
                                    <input type="text" id="username" class="form-control"  value="<?php echo $home["username"]; ?>" placeholder="请输入邮箱服务器地址">
                                </div>
                                <div class="mb-3"><label class="form-label">管理员密码：</label>
                                    <div><input type="text" id="password" class="form-control"  value="<?php echo $home["password"]; ?>" placeholder="请输入邮箱端口"></div>
                                </div>
                                <div class="text-center">
                                    <div><button type="submit" id="submit" class="btn btn-success waves-effect waves-light">更新管理员信息</div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div><!-- end col -->
            </div><!-- end row -->
        </div><!-- container-fluid -->
    </div><!-- End Page-content -->
    <footer class="footer">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">
                    <script>
                        document.write(new Date().getFullYear())
                    </script>(c) Cloud.
                </div>
                <div class="col-sm-6">
                    <div class="text-sm-end d-none d-sm-block">Crafted with <i class="mdi mdi-heart text-danger"></i>By <a href="https://www.9gyun.cn">云风轻产品授权中心</a></div>
                </div>
            </div>
        </div>
    </footer>
</div><!-- end main content-->
<!--End 页面主要内容-->
<?php include("footer.php"); ?>
<script src="http://lyear.itshubao.com/iframe/js/bootstrap-notify.min.js"></script>
<script type="text/javascript" src="http://lyear.itshubao.com/iframe/js/lightyear.js"></script>
<script src="http://libs.itshubao.com//tinymce/tinymce.min.js"></script>
<script src="../assets/js/sweetalert2.min.js"></script>
<script language="JavaScript">
    $(document).ready(function (){
        $("#submit").click(function (){
            var username=$("#username").val();
            var password=$("#password").val();
            if (!username || !password){
                return false;
            }else{
                    $.ajax({
                        type: "POST",
                        url:"set.php?act=setpass",
                        data:{username:username,password:password},
                        dataType:"json",
                        success:function (data) {
                            if (data.state==1){
                                Swal.fire("更新成功!", "恭喜你，更新成功!", "success");
                            }else{
                                Swal.fire("更新失败!", "更新失败，可能未做更新!", "error");
                            }
                        }
                    });
                }
                });
    });

</script>
</body>
</html>